extends Control

signal menu_closed()

func _ready() -> void:
	set_process_mode(Node.PROCESS_MODE_ALWAYS) #确保节点 即使在游戏暂停时也能继续运行 。

func _on_back_2_game_button_pressed() -> void:
	get_tree().paused = false
	menu_closed.emit()
	queue_free()

func _on_back_2_main_menu_button_pressed() -> void:
	get_tree().paused = false
	menu_closed.emit()
	queue_free()
	get_tree().change_scene_to_file("res://scene/start_menu.tscn")

func _on_exit_button_pressed() -> void:
	get_tree().quit()
		
func _on_save_game_pressed() -> void:
	Global.save_game()
